package com.happyfamily.springboot.crowdsourcingplatform.service.sun.impl;

import com.happyfamily.springboot.crowdsourcingplatform.dao.sun.SysUserDao;
import com.happyfamily.springboot.crowdsourcingplatform.model.SysUser;
import com.happyfamily.springboot.crowdsourcingplatform.service.sun.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class SysUserServiceImpl implements SysUserService
{
	@Autowired(required = false)
	private SysUserDao userDao;

	@Override
	public boolean updateMoney(String money, Long uid)
	{
		boolean flag=false;
		int n=userDao.updateMoney(money, uid);
		if(n>0)
		{
			flag=true;
		}
		return flag;
	}

	@Override
	public SysUser getUser(String account)
	{
		return userDao.getUser(account);
	}

	@Override
	public SysUser getUserById(Long uid)
	{
		return userDao.getUserById(uid);
	}

	@Override
	public boolean updateCount(String account, Integer count)
	{
		boolean flag=false;
		int n=userDao.updateCount(account, count);
		if(n>0)
		{
			flag=true;
		}
		return flag;
	}
}